package com.github.livebase.util;

import java.util.Objects;

public class Triplets<K, V, W> {
    protected K key;
    protected V value;
    protected W attach;

    public Triplets(K key, V value, W attach) {
        this.key = key;
        this.value = value;
        this.attach = attach;
    }

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public W getAttach() {
        return attach;
    }

    public void setAttach(W attach) {
        this.attach = attach;
    }

    public void setValue(V value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Triplets)) return false;
        Triplets<?, ?, ?> triplets = (Triplets<?, ?, ?>) o;
        return key.equals(triplets.key) && value.equals(triplets.value) && attach.equals(triplets.attach);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key, value, attach);
    }
}
